Personal tools

Lua/Events/Client/VehicleCollide

From JC2-MP Documentation

< Lua
Jump to: navigation, search
Name    VehicleCollide
Arguments (in table)    Vehicle attacker, ClientEntity entity, number impulse, Vehicle vehicle, Player player
Return option    None


Description

Fired when an attacker vehicle collides with another entity. attacker is always a valid vehicle. vehicle and player are there for backward compatibility.

Examples

Foo = function(args)
	if args.vehicle then
		print(args.attacker:GetName().." collided with "..args.vehicle:GetName())
	elseif args.player then
		print(args.attacker:GetName().." collided with "..args.player:GetName())
	end
end
 
Events:Subscribe("VehicleCollide", Foo)